


cc.Class({
    extends: cc.Component,

    properties: {},
    onLoad() {
        // 拿到父亲
        this.enemy = this.node.parent.getComponent('enemy')

    },
    // 碰撞回调
    onCollisionEnter(other, self) {
        if(other.size.width == 0 || other.size.height == 0) {

            return
        }
        console.log('other', other)
        if (other.node._name === 'hero') {
            this.enemy.hurt()
        }
    },
    start() {
    },
    // update (dt) {},
});

